package cn.lsngo.manager;

import java.util.List;

import cn.lsngo.manager.greendao.ElectricBean;
import cn.lsngo.manager.greendao.gen.ElectricBeanDao;

/**
 * @author : admin
 * @Title :
 * @date : 2021/12/23 15:51
 */
public class DataModule {
    public static ElectricBean queryElectric(Long id) {
        ElectricBeanDao electricBeanDao = getElectricDao();
        ElectricBean electricBean = electricBeanDao.queryBuilder().where(ElectricBeanDao.Properties.Id.eq(id)).unique();
        return electricBean;
    }

    public static ElectricBeanDao getElectricDao() {
        return DbManager.getInstance().getDaoSession().getElectricBeanDao();
    }

    public static List<ElectricBean> queryAllElectric() {
        List<ElectricBean> electricBeans = getElectricDao().loadAll();
        return electricBeans;
    }
}
